package com.iplant.base.po;


import com.fasterxml.jackson.annotation.JsonProperty;
import com.iplant.base.utils.annotation.po.DBBasePO;
import com.iplant.base.utils.annotation.condition.DBCondition;
import com.iplant.base.utils.annotation.field.DBField;

import java.util.Calendar;

/***
 *  @author xiuto
 */
@DBBasePO(TableName = "mbs_api_log", Code = false, Active = false)
public class TraceLogInfo extends BasePO {

    public TraceLogInfo(){
        super();
    }
    public TraceLogInfo(RequestMappingAPI wRequestMappingAPI){
        super();
        Name=wRequestMappingAPI.Name;
        ProjectName=wRequestMappingAPI.ProjectName;
        URI=wRequestMappingAPI.Uri;
        Method=wRequestMappingAPI.Method;
        ModuleName=wRequestMappingAPI.ModuleName;
        Message=wRequestMappingAPI.Pattern;
    }
    @DBCondition
    @DBField
    public int CompanyID = 0;

    @DBCondition
    @DBField(length = 45)
    public String ProjectName = "";
    @DBCondition
    @DBField(length = 128)
    public String URI = "";

    @DBCondition
    @DBField(length = 10)
    public String Method = "";

    /**
     * 模块名称
     */
    @DBCondition(CompareType = DBCondition.DBCompareType.like)
    @DBField(length = 45)
    public String ModuleName = "";

    @DBField(length = 128)
    public String Message = "";
    @DBField(length = 512)
    public String Params = "";

    @DBField(length = 512)
    public String Result = "";

    @DBField(length = 512)
    public String RequestBody = "";

    @DBCondition(CompareType = DBCondition.DBCompareType.geLe,
            ParamName = "StartTime",ParamName2 = "EndTime",MustCondition = true)
    @DBField
    public Calendar RequestTime = Calendar.getInstance();

    @DBField
    public Calendar ResponseTime = Calendar.getInstance();

    @DBField
    public int IntervalTime = 0;

    @DBCondition
    @DBField
    public int ResponseStatus = 0;

    @DBField(length = 10)
    public String CreatorName = "";
    @DBField(length = 10)
    public String EditorName = "";

    @JsonProperty("CompanyID")
    public int getCompanyID() {
        return CompanyID;
    }

    public void setCompanyID(int companyID) {
        CompanyID = companyID;
    }

    @JsonProperty("ProjectName")
    public String getProjectName() {
        return ProjectName;
    }

    public void setProjectName(String projectName) {
        ProjectName = projectName;
    }

    @JsonProperty("URI")
    public String getURI() {
        return URI;
    }

    public void setURI(String URI) {
        this.URI = URI;
    }

    @JsonProperty("Method")
    public String getMethod() {
        return Method;
    }

    public void setMethod(String method) {
        Method = method;
    }

    @JsonProperty("Message")
    public String getMessage() {
        return Message;
    }

    public void setMessage(String message) {
        Message = message;
    }

    @JsonProperty("Params")
    public String getParams() {
        return Params;
    }

    public void setParams(String params) {
        Params = params;
    }

    @JsonProperty("Result")
    public String getResult() {
        return Result;
    }

    public void setResult(String result) {
        Result = result;
    }

    @JsonProperty("RequestBody")
    public String getRequestBody() {
        return RequestBody;
    }

    public void setRequestBody(String requestBody) {
        RequestBody = requestBody;
    }

    @JsonProperty("RequestTime")
    public Calendar getRequestTime() {
        return RequestTime;
    }

    public void setRequestTime(Calendar requestTime) {
        RequestTime = requestTime;
    }

    @JsonProperty("ResponseTime")
    public Calendar getResponseTime() {
        return ResponseTime;
    }

    public void setResponseTime(Calendar responseTime) {
        ResponseTime = responseTime;
    }

    @JsonProperty("IntervalTime")
    public int getIntervalTime() {
        return IntervalTime;
    }

    public void setIntervalTime(int intervalTime) {
        IntervalTime = intervalTime;
    }

    @JsonProperty("ResponseStatus")
    public int getResponseStatus() {
        return ResponseStatus;
    }

    public void setResponseStatus(int responseStatus) {
        ResponseStatus = responseStatus;
    }

    @Override
    @JsonProperty("CreatorName")
    public String getCreatorName() {
        return CreatorName;
    }

    @Override
    public void setCreatorName(String creatorName) {
        CreatorName = creatorName;
    }

    @Override
    @JsonProperty("EditorName")
    public String getEditorName() {
        return EditorName;
    }

    @Override
    public void setEditorName(String editorName) {
        EditorName = editorName;
    }

    @JsonProperty("ModuleName")
    public String getModuleName() {
        return ModuleName;
    }

    public void setModuleName(String moduleName) {
        ModuleName = moduleName;
    }



}
